#-*-encoding=utf-8-*-
steps = [
    FlowStep(
        name=u'init',
        title=u'提交',
        fields=[u'title', u'canguan', u'price', u'start', u'description'],
        responsibles=u'sheet is None and [request.principal.id] or sheet["creators"]',
    actions=[
        FlowStepAction(
            name=u'submit',
            title=u'提交',
            nextsteps=[u'review'],
            finish_condition=u''
)
])
,

    FlowStep(
        name=u'review',
        title=u'定餐',
        fields=[u'title', u'canguan', u'price', u'start'],
        responsibles=u'flowsettings["dingcanren"]',
    actions=[
        FlowStepAction(
            name=u'accept',
            title=u'通过',
            nextsteps=[],
            trigger=ur"""# 定餐成功，需要扣费
user_money = parentcontainer['user_money']
username = [sheet['creators'][0]]
money = ITinyTable(user_money.values()).queryOneRow(username=username).get('money')
ITinyTable(user_money.values()).setValue('money', money - sheet['price'], username=username )"""
),

        FlowStepAction(
            name=u'reject',
            title=u'打回',
            nextsteps=[u'init'],
            finish_condition=u''
)
])
]
